﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Orchard.Mvc.Routes;
using System.Web.Routing;
using System.Web.Mvc;
using Orchard.Environment.Extensions;

namespace Contrib.Mod.ResetPassword
{
    public class Routes : IRouteProvider
    {
        public static string Area { get { return "Contrib.Mod.ResetPassword"; } }

        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            yield return new RouteDescriptor
            {
                Priority = 5,
                //Name = "Profile-Survey",
                Route = new Route("hey/changepassword",
                        new RouteValueDictionary {
                                                {"area", Area},
                                                {"controller", "Reset"},
                                                {"action", "RequestPassword"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary { { "area", Area } },
                        new MvcRouteHandler())
            };

            //yield return new RouteDescriptor
            //{
            //    Priority = 5,
            //    //Name = "Profile-Survey",
            //    Route = new Route("hey/changepasswordpost",
            //            new RouteValueDictionary {
            //                                    {"area", Area},
            //                                    {"controller", "Reset"},
            //                                    {"action", "RequestPasswordPost"}
            //            },
            //            new RouteValueDictionary(),
            //            new RouteValueDictionary { { "area", Area } },
            //            new MvcRouteHandler())
            //};
        }
    }
}